#include "head.h"
void exec_test()
{
    int fd = open("ps.txt",O_RDWR|O_CREAT,0666);
    if(fd<0){

        perror("open file error");
        exit(1);
    }
    int r= dup2(fd,STDOUT_FILENO);
    if(r<0){
        perror("DUP2 error");
        exit(1);
    }

    execlp("ps","ps","ajx",NULL);
    perror("execlp error");
}